package com.stone.framework.message.user;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

import com.fasterxml.jackson.annotation.JsonProperty;

import io.swagger.annotations.ApiModelProperty;

public class ResourceReqBody {

    @ApiModelProperty(value = "主键", name = "menuId")
    @JsonProperty(value = "menuId")
    private Long id;

    @ApiModelProperty(value = "上级资源", required = true)
    @NotNull(message = "[parentId] {title.notNull}")
    @Min(value = 0, message = "[parentId] {title.min} 0")
    private Long parentId;

    @ApiModelProperty(value = "资源代码", required = true)
    @NotBlank(message = "[code] {title.notBlank}")
    private String code;

    @ApiModelProperty(value = "资源名称", required = true)
    @NotBlank(message = "[name] {title.notBlank}")
    private String name;

    @ApiModelProperty(value = "资源描述", required = true)
    @NotBlank(message = "[desc] {title.notBlank}")
    private String desc;

    @ApiModelProperty(value = "图标")
    private String icon;

    @ApiModelProperty(value = "url", name = "url")
    @JsonProperty(value = "url")
    private String label;

    @ApiModelProperty(value = "顺序", name = "orderNum", required = true)
    @NotNull(message = "[orderNum] {title.notNull}")
    @JsonProperty(value = "orderNum")
    @Min(value = 0, message = "[orderNum] {title.min} 0")
    private Integer order;

    @ApiModelProperty(value = "资源类型：MENU|LIST|BUTTON", required = true)
    @NotNull(message = "[type] {title.notNull}")
    @Pattern(regexp = "(MENU|LIST|BUTTON)", message = "[type] must be 'MENU|LIST|BUTTON'")
    private String type;

    @ApiModelProperty(value = "资源状态：DISABLED|ENABLED", required = true)
    @NotNull(message = "[state] {title.notNull}")
    @Pattern(regexp = "(DISABLED|ENABLED)", message = "[state] must be 'DISABLED|ENABLED'")
    private String state;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getParentId() {
        return parentId;
    }

    public void setParentId(Long parentId) {
        this.parentId = parentId;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public String getIcon() {
        return icon;
    }

    public void setIcon(String icon) {
        this.icon = icon;
    }

    public String getLabel() {
        return label;
    }

    public void setLabel(String label) {
        this.label = label;
    }

    public Integer getOrder() {
        return order;
    }

    public void setOrder(Integer order) {
        this.order = order;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getState() {
        return state;
    }

    public void setState(String state) {
        this.state = state;
    }

}
